<?php
$rEmailhtml = '';
$submitbtn = '<input type="button" id="reg-submit" alt="Submit" />';
$prodhtml = '';
if($type == 'vip'){
	$rEmailhtml = '<p class = "reg"><label>Confirm Email Address :</label><input type = "text" value = "" name = "reg-re-email" id = "reg-re-email" /> <span id = "r-email"></span></p><p class="note" id="de-cea">Once more, just to make sure.</p><p id="er-cea" class="note error" style="display: none;">Please fill up Confirm Email Address.</p>';
	$prodhtml = '';
	$prodhtml .= '<h2 id="commercial-d">Membership Details</h2>';
	$prodhtml .= '<input type="hidden" name="prodid" value="'.$product_details->productid.'" />';
	$prodhtml .= '<p>';
	$prodhtml .= '<ul>';
	$prodhtml .= '<li class="m-prod"><p><input type="radio" checked="checked" class="product-list"/>';
	$prodhtml .= '<span id="prod-name">'.$product_details->name.'</span></p>';
	$prodhtml .= '<p class="prod-desc">'.$product_details->description.'</p></li>';
	$prodhtml .= '<li class="m-prod"><p><span id="prod-price-f">'.$this->config->item('currency_symbol').' </span><span id="prod-price">'.number_format($product_details->price, 2).'</span><input type="hidden" id="origvipprice" value="'.$product_details->price.'" />';
	$prodhtml .= '<label id="l-packcode">Package Code </label><input type="text" name="package_code" id="i-packcode" value=""  />';
	$prodhtml .= '<a href="#" id="a-ok"><u>OK</u></a>';
	$prodhtml .= '<img src="'.base_url().'assets/images/signup/icon-question.png" id="help-icon" /><div id="d-help-wrap"><div id="d-help">If you have purchased your account from a reseller, please enter your package code and click OK.</div></div>';
	$prodhtml .= '</p>';
	$prodhtml .= '<p class="note def" id="de-pack">Valid Package Code. The amount has been modifed.<br>Reseller Name: <font id="reseller-name">Lala</font></p>';
	$prodhtml .= '<p class="note error" id="er-pack">Invalid Package Code!</p>';
	$prodhtml .= '</li>';
	$prodhtml .= '</ul>';
	$prodhtml .= '</p>';
	$submitbtn = '<input type="button" id="reg-checkout-submit" alt="Submit" />';
} else if($type == 'reseller'){
	$rEmailhtml = '<p class = "reg"><label>Confirm Email Address :</label><input type = "text" value = "" name = "reg-re-email" id = "reg-re-email" /> <span id = "r-email"></span></p><p class="note" id="de-cea">Once more, just to make sure.</p><p id="er-cea" class="note error" style="display: none;">Please fill up Confirm Email Address.</p>';
	$prodhtml = '';
	$prodhtml .= '<h2 id="commercial-d">Select Your Product Package</h2>';
	$prodhtml .= '<p>';
	$prodhtml .= '<ul>';
	if(!empty($product_detailsA)){
		foreach($product_detailsA as $product_details){
			$prodhtml .= '<li class="m-prod m-prod-r"><p><input type="radio" checked="checked" class="product-list-r" name="prodid" value="'.$product_details->productid.'"/>';
			$prodhtml .= '<span id="prod-name-r">'.$product_details->name;
			$prodhtml .= '<br><span id="prod-price-f">'.$this->config->item('currency_symbol').' </span>';
			$prodhtml .= '<span id="prod-price">'.number_format($product_details->price, 2).'</span>';
			$prodhtml .= '<input type="hidden" id="origvipprice" value="'.$product_details->price.'" /></li>';
		}
	}
	$prodhtml .= '</ul></p>';
	$submitbtn = '<input type="button" id="reg-checkout-submit" alt="Submit" />';
}
?>

<div id = "register-area-bg">
	<div id = "register-area">
		<h2><img src = "<?php echo base_url(); ?>assets/images/register-h2.png" alt = "" /><img src="<?php echo base_url() ?>assets/images/signup/<?php echo $type ?>-signup2.png" class="inline-signup" /></h2>
		<div id = "register">
			<form name="frm_register" id="frm_register" action = "<?php echo base_url().'register/'.$type ?>" method = "POST">
				<div>
				<p class = "reg"><label>First Name :</label><input type = "text" value = "<?php echo !empty($post_data['user_username']) ? $post_data['user_username'] : ''; ?>" name = "reg-full-name" id = "reg-first-name" /><span id = "f-name"></span></p>
				<p class="note def" id="de-fn">Required.</p>
				<p class="note error" id="er-fn">Please specify First Name.</p>
				<p class = "reg"><label>Last Name :</label><input type = "text" value = "" name = "reg-last-name" id = "reg-last-name" /> <span id = "l-name"></span></p>
				<p class="note def" id="de-ln">Required.</p>
				<p class="note error" id="er-ln">Please specify Last Name.</p>
				<p class = "reg"><label>Middle Name :</label><input type = "text" value = "" name = "reg-middle-name" id = "reg-middle-name" /> <span id = "m-name"></span></p>
				<p class="note def" id="de-mn">Required.</p>
				<p class="note error" id="er-mn">Please specify Middle Name.</p>
				<p class = "reg"><label>Email Address :</label><input type = "text" value = "<?php echo !empty($post_data['user_email']) ? $post_data['user_email'] : '';?>" name = "reg-email" id = "reg-email" /> <span id = "e-mail"></span></p>
				<p class="note def" id="de-ea">Required. We'll never share this with anyone.</p>
				<p class="note error" id="er-ea">Please specify Email Address.</p>
				<?php echo $rEmailhtml ?>
				<p class = "reg"><label>Password :</label><input type = "password" value = "<?php echo !empty($post_data['user_password']) ? $post_data['user_password'] : '';?>" name = "reg-password" id = "reg-password" /> <span id = "p-ass"></span></p>
				<p class="note def" id="de-pa">Required. Must be at least 5 characters long.</p>
				<p class="note error" id="er-pa">Please specify password and must be 5 characters long.</p>
				<p class = "reg"><label>Confirm Password :</label><input type = "password" value = "" name = "reg-re-password" id = "reg-re-password" /> <span id = "r-pass"></span></p>
				<p class="note def" id="de-cp">One more time to be safe.</p>
				<p class="note error" id="er-cp">Please specify password and must be 5 characters long.</p>
				<p class = "reg">
					<label>Captcha :</label><input id="captcha" type="text" value=""  name="captcha" maxlength="7" size="7" /> <span id = "c-aptcha"></span>
					<div id = "reg_captcha">
						<img src="<?php echo base_url(); ?>captcha" title="Captcha" alt="Catcha" />
					</div>
				</p>
				<p class="note def" id="de-ca">Copy the code at the right. This is to prove that you are a human.</p>
				<p class="note error" id="er-ca">Invalid Captcha.</p>
				<p class = "reg" id="terms-p">
					<input type = "checkbox" name = "checkbox" id = "checkbox" />
					<span style = "color:#444; margin-left:5px; font-weight:bold">I have read and agreed to the <u id = "terms-title">Terms of Use.</u></font></span>
					<span id = "reg-check"></span>
				</p>
				<p class="note error" id="er-te">Please agree to the Terms of Use.</p>
				<div id = "terms-content">
					<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse id eleifend ligula. Integer quis erat vel sem vestibulum mollis eu quis erat. Etiam dictum enim at massa ultricies fringilla. Sed pulvinar ipsum non lacus facilisis tristique sit amet in felis. Etiam dictum placerat odio quis gravida. Fusce at nunc urna, at tincidunt ante. Proin magna metus, faucibus vitae gravida et, pulvinar ut sapien. Proin ac odio elit. Phasellus porta massa at nibh luctus pharetra interdum leo pretium. </p>
					<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse id eleifend ligula. Integer quis erat vel sem vestibulum mollis eu quis erat. Etiam dictum enim at massa ultricies fringilla. Sed pulvinar ipsum non lacus facilisis tristique sit amet in felis. Etiam dictum placerat odio quis gravida. Fusce at nunc urna, at tincidunt ante. Proin magna metus, faucibus vitae gravida et, pulvinar ut sapien. Proin ac odio elit. Phasellus porta massa at nibh luctus pharetra interdum leo pretium. </p>
					<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse id eleifend ligula. Integer quis erat vel sem vestibulum mollis eu quis erat. Etiam dictum enim at massa ultricies fringilla. Sed pulvinar ipsum non lacus facilisis tristique sit amet in felis. Etiam dictum placerat odio quis gravida. Fusce at nunc urna, at tincidunt ante. Proin magna metus, faucibus vitae gravida et, pulvinar ut sapien. Proin ac odio elit. Phasellus porta massa at nibh luctus pharetra interdum leo pretium. </p>
				</div>
				</div>
				<div id="product-details-d">
				<p class = "reg"><?php echo $prodhtml ;?></p>
				</div>
				<input type="hidden" value="<?php echo $type ?>" name="type" />
				<input type="hidden" name="action" value="1" />
				<input type="hidden" name="captcha_validate" id="captcha_validate" value="0" />
				<input type="hidden" name="email_validate" id="email_validate" value="0" />
				<input type="hidden" name="baseurl" id="baseurl" value="<?php echo base_url() ?>" />
				<p class = "reg-btn" style="margin-top:20px;">
					<?php echo $submitbtn; ?>
				</p>
			</form>
		</div>
	</div>
</div>